Aslp generating control flow branches#188
Merged
Merged
Conversation
dont need helper functions anymore
agle
reviewed
Jun 23, 2026
| |> Aslp_state.add_block ~pred:st.active ~name:f ~assume:ncond | ||
| |> Aslp_state.add_block ~pred:t ~name:m | ||
| |> Aslp_state.add_goto ~source:f ~target:m | ||
| |> Aslp_state.modify_block ~name:m ~f:(fun b -> |
Owner
There was a problem hiding this comment.
Put the Aslp_state local open outside of the sequence of maps :)
agle
approved these changes
Jun 23, 2026
| let gen_block_id = gen_block_id | ||
| let gen_local_id = gen_local_id | ||
| let block_id = ID.name % ID.fresh ~name:"block" block_ids | ||
| and local_id = ID.name % ID.fresh ~name:"var" local_ids in |
Owner
There was a problem hiding this comment.
I always prefer ID.fresh ~name:"var" local_ids %> ID.name
| |> Aslp_state.add_block ~pred:st.active ~name:f ~assume:ncond | ||
| |> Aslp_state.add_block ~pred:t ~name:m | ||
| |> Aslp_state.add_goto ~source:f ~target:m | ||
| |> Aslp_state.modify_block ~name:m ~f:(fun b -> |
| This is used to maintain the invariant that at every control flow point, the | ||
| [PC] variable is either assigned on all paths or assigned on no paths (from | ||
| the beginning of the instruction). *) | ||
| let ensure_pc_consistency state ~left ~right ~join = |
Owner
There was a problem hiding this comment.
Mention guarantee from lifter that it won't assign PC twice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ensures a pc increment on all straight-line control-flow paths by construction.
adds a new lib/transforms/aslp/aslp_lexpr.ml file for abstracting the builtin and local variables used by the aslp lifter.
this pr also renames some things, like now using
aslp_diamondin place ofaslp_state.